/*
var canvas = document.createElement("canvas");
canvas.classList.add("layer")
canvas.id = "myCanvas"
canvas.width = document.body.clientWidth
canvas.height = document.body.clientHeight
canvas.setAttribute("width", document.body.clientWidth)
canvas.setAttribute("height", document.body.clientHeight)
document.body.appendChild(canvas);
*/
document.body.style.zoom = 0.5;

var canvas = document.getElementById("myCanvas");
canvas.setAttribute("width", document.body.clientWidth)
canvas.setAttribute("height", document.body.clientHeight)

var rdate; //用于记录每次触发resize的时间
var timer = null;
var delta = 200; //200ms时间差
function resizeEnd() {
	//再等等~
	if (new Date() - rdate < delta) {
		setTimeout(resizeEnd, delta);
	} else {
		timer = null;
		//trigger 一个resizeend事件
		//    $(window).trigger("resizeend");
		window.location.reload();
	}
}
window.onresize = function() {
	rdate = new Date();
	if (timer === null) {
		timer = setTimeout(resizeEnd, delta);
	}
	//	Init()
}


